feat(checkpoints): per-step change card core: payload builder, emission hook, changeCardDetail setting (B3a v2-7, epic #1375) - #49
Open
easonLiangWorldedtech wants to merge 2 commits into
Conversation
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Required CI passed. Waiting for automated review of the latest commit. If automated review does not start, a maintainer must restart it. Review-state labels are managed by this workflow; do not edit them manually. |
…on hook, changeCardDetail setting (B3a v2-7, epic Zoo-Code-Org#1375) Change-card pipeline on the extension host for each completed tool-write step: - change_card ClineSay + ChangeCardData/ChangeCardFile/ChangeCardDetail schemas (packages/types) - changeCardDetail user setting (default 'summary') + ExtensionState + ClineProvider getState/getStateToPostToWebview round trip - buildChangeCardPayload(): reuses the approval diff stats already computed by the tools; auto-approved steps are always downgraded to 'summary' - checkpointSave emits task.say('change_card', ...) only when a real commit and write info exist; a card failure is logged and never disables checkpoints Split of the reviewed B3a content (legacy Zoo-Code-Org#1411) - unit 1 of 4 (v2-7). Stacks on v2-4 (PR #48).
easonLiangWorldedtech
force-pushed
the
feat/fws-v2-7-changecard-core
branch
from
September 6, 2026 00:54
11eeb88 to
a552872
Compare
…s renders after B1 allowEmpty baseline checkpoint)
easonLiangWorldedtech
force-pushed
the
feat/fws-v2-7-changecard-core
branch
from
September 6, 2026 02:16
e687f18 to
54bd92f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
v2-7 of the file-write safety v2 rebuild (epic #1375): change-card core (B3a) ??the per-step change-card pipeline end to end on the extension host: types + user setting, the card payload builder, and the emission hook in
checkpointSave. This is unit 1 of 4 in the split of the reviewed B3a content (legacy #1411, 1891 lines standalone ??v2-7 core, v2-8a apply-diff tool wiring, v2-8b apply-patch/edit/search tool wiring, v2-9 settings/i18n UI).packages/types/src/message.ts??newchange_cardClineSay (documented in theclineSaystable) plus the payload schemas:ChangeCardDetail(full | summary),ChangeCardFile(path, +/??counts, optional inline unified diff),ChangeCardData(checkpointIds, files, totalFiles, detail).packages/types/src/global-settings.ts??thechangeCardDetailuser setting (optional, enum) with shared defaultDEFAULT_CHANGE_CARD_DETAIL = summary. summary keeps cards compact (file list with +/??counts; the UI fetches diffs lazily ??v2-9+); full carries the unified diff inline per file.packages/types/src/vscode-extension-host.ts??changeCardDetailonExtensionState(webview half of the round trip; the UI control lands in v2-9).src/core/checkpoints/changeCard.ts(new) ??buildChangeCardPayload(commit, writes, detail): one card per completed tool write step, keyed by the shadow-git checkpoint. It reuses the approval diff/stats the tool already computed (CheckpointWriteInfo.diff, never recomputed) and always downgrades to summary for auto-approved steps regardless of the user setting.src/core/checkpoints/index.ts??CheckpointWriteInfogainsdiff?andautoApproved?;checkpointSavenow emitstask.say(change_card, ...)after a real commit exists (same guard as the journal: onlyresult?.commit && write). A card failure is logged and never disables checkpoints ??the emission is strictly additive on top of the v2-3/v2-4 journal hook.src/core/webview/ClineProvider.ts??changeCardDetailingetState()andgetStateToPostToWebview()(with the shared default), completing the storage-to-webview round trip per the settings checklist.changeCard.spec.ts(payload builder: full vs summary detail, inline diff presence, auto-approved downgrade, empty-write edge) andindex.checkpointSave.spec.ts(emission: one card per step, checkpointIds, detail from livegetState(), failure swallowed without disabling checkpoints, non-write saves emit nothing; theindex.prefix follows the v2-4index.checkpointJournal.test.tsconvention so the suite is picked up as a direct test ofindex.tsby the Stryker diff gate);ClineProvider.spec.ts+4 tests (saved value reachesgetState/getStateToPostToWebview, default summary when unset);index.checkpointJournal.test.ts+8 (test doubles keep the emission on the happy path).Gates (local, pre-push)
message/global-settings(packages/types) ??10 passed;changeCard/index.checkpointSave/index.checkpointJournal/ClineProvider(src) ??186 passed.--max-warnings=0on all 10 touched files (fullzoo-codelint via pre-commit);eslint-suppressions.jsoncounts unchanged.pnpm check-types: clean.scripts/stryker-diff.mjs ci, base6c2ac075c= v2-4 head, head this commit): 42 changed-code mutants (31 inchangeCard.ts, 9 in theindex.tsemission block, 2 inClineProvider.ts), all Killed ??0 Survived / 0 NoCoverage.Equivalent mutants
None ??the final run is clean (0 Survived / 0 NoCoverage), so no exclusion directives were needed. The emission-failure test pins the exact
console.errormessage, which kills the catch-block mutants (empty block, message string) rather than excluding them.Line budget
Standalone diff vs the PR base (
6c2ac075c): 566 lines (564+/2?? 10 files) ??over the 400-line soft design target.Stacking / merge order
Base:
feat/fws-v2-4-journal-wiring(PR #48). v2-8a (apply-diff tool wiring) and v2-8b (apply-patch/edit/search tool wiring) stack on this PR; v2-9 (settings UI + i18n) stacks on those. After the whole v2-7..v2-9 chain lands on main, each base switches tomainwith an identical diff.Visual regression re-baseline (extension-host-visual)
The deterministic
electron-chat-dark-sidebardiff is root-caused and fixed in54bd92f71:checkpointSave(true, true), allowEmpty). In the mock completion scene it commits an empty baseline and posts acheckpoint_savedwebview message (suppressed, so its row stays hidden). However, the pre-existinggetCompletionCheckpoint()inpackages/typesscans the full message list, finds that checkpoint, and setscompletionCheckpointon the completion row, so the pre-existingSeeNewChangesButtonscomponent ("See New Changes" / "Restore Changes") now renders. On upstream main the comparable pre-prompt checkpoint is not allowEmpty and is a no-op in the clean mock workspace, so the old baseline had no buttons.